package dongshi.daddy.skiplist;

/**
 * 
 * @author dongyunqi
 * @date 2018年12月5日下午2:41:28
 * @description
 */
public class SkipListTest {

	public static void main(String[] args) {
		String[] dataArr = new String[] { "tom-200", "jack-100", "lucy-300", "james-600",
				"ressel-500", "ball-800", "rose-700", "scott-400" };
		SkipList skipList = new SkipList();
		String curData;
		for (int i = 0; i < dataArr.length; i++) {
			curData = dataArr[i];
			skipList.insert(curData.split("-")[0], Integer.valueOf(curData.split("-")[1]));
		}
		skipList.printAll();
		skipList.find(3300);
		System.out.println("删除前");
		skipList.printAll();
		skipList.delete(300);
		System.out.println("删除300后");
		skipList.printAll();
		skipList.delete(100);
		System.out.println("删除100后");
		skipList.printAll();
		skipList.delete(800);
		System.out.println("删除800后");
		skipList.printAll();
		skipList.insert("3-data", 3);
		System.out.println("插入3后");
		skipList.printAll();
		skipList.insert("1000-data", 1000);
		System.out.println("插入1000后");
		skipList.printAll();
	}
	
}
